home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr26
/
blrmu13.zip
/
TSSC.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-06-01
|
14KB
|
536 lines
page ,132
title tssc (test, set, save, colors) as of 08/30/90 - 12:15 am
;
; included macro libraries
; from /masminc
;
if1
.xlist
include genmac.lib
include iomac.lib
include vdomac.lib
.list
endif
;
; common equates
;
z equ 0 ; zero
lf equ 10 ; line feed
cr equ 13 ; carriage return
ek equ 27 ; escape key
;
;-------------------------------------
code segment para public 'code'
;-------------------------------------
;
assume cs:code
;
org 256 ; past PSP
;
sop: jmp tssc ; start of program
;-----------------
; work area
;-----------------
;
db 'start of work area'
;
ofh dw z ; output file handle
odn db z ; output drive #
ofn db 'tssc' ; save
db '.' ; file
db 'com' ; name
db z
;
sm1 db '┌────────────────────────────────────────┐',cr,lf,z
sm2 db '│ Test, Set, Save, Colors │',cr,lf,z
sm3 db '├────────────────────────────────────────┤',cr,lf,z
sm4 db '│ ( by Bud Rasmussen ) │',cr,lf,z
sm5 db '├────────────────────────────────────────┤',cr,lf,z
sm6 db '│ QUIT at any time by pressing ESC key │',cr,lf,z
sm7 db '└────────────────────────────────────────┘',cr,lf,lf,z
;
; color save areas
;
sbc db 15 ; save border color
sbbc db 3 ; save border box color
ssc db 6 ; save screen color
srtc db 14 ; save requested text color
cstc db 06eh ; combined scrn / text color
cbbc db 03fh ; combined border box color
;
rbcm db ' * request border color from 0 to f : ',z
rsbcm db ' * request screen box color from 0 to f : ',z
rsblcm db ' * request screen box line color from 0 to f : ',z
rscm db ' * request screen color from 0 to f : ',z
rtcm db ' * request cursor color from 0 to f : ',z
rbgcm db ' * request background text color 40 - 47 : ',z
rfgcm db ' * request foreground text color 30 - 37 : ',z
;
cokm db ' * is that all right ? ( y or n ) : ',z
;
tam db ' * do you wish to test more ? ( y or n ) : ',z
;
satcm db ' * do you wish to set these colors ? ( y or n ) : ',z
;
conm db ' * do you wish to save these colors ? ( y or n ) : ',z
;
acm1 db ' 0=blk, 1=blu, 2=grn, 3=cyan, 4=red,'
db ' 5=mag, 6=brn, 7=wht, 8=lt blk, ',z
acm2 db ' 9=lt blu, a=lt grn, b=lt cyan, c=lt red,'
db ' d=lt mag, e=lt brn, f=lt wht ',z
;
acm3 db ' 40=blk, 41=red, 42=grn, 43=yelo, 44=blu,'
db ' 45=mag, 46=cyan, 47=wht, ',z
acm4 db ' 30=blk, 31=red, 32=grn, 33=yelo, 34=blu,'
db ' 35=mag, 36=cyan, 37=wht ',z
;
ess db 27,'['
bcs db '43' ; background color store
db ';'
db '1'
db ';'
fcs db '33' ; foreground color store
db 'm$'
;
rr db z ; reply area
vcf db z ; validate color flag
ef db z ; exit flag
;
; miscellaneous constants
;
cll db cr,lf,lf,z ; cr, lf, lf
crlf db cr,lf,z ; cr, lf
;
; included data
; from /masminc
;
.xlist
include ccwa.dta
include colors.dta
include escseq.dta
.list
.sall
;
db 'end of work area'
;
tssc proc near
;
call scaa ; save char and attr
;
; main section
;
ms:
;
mov ef,0
;
;-----------------------------
; request border color
;-----------------------------
rbc:
call sacm
call lsccm
scp 12,0
call mcr3
lea ax,rbcm
call lmts
call vcp
cmp vcf,1
je rbcrtd
cmp vcf,2
je rbc
mov sbc,al
jmp stbc
;
rbcrtd: jmp rtd
;
;-------------------------
; set the border color
;-------------------------
stbc:
mov ah,11 ; set color palette fct
mov bh,0 ; text mode
mov bl,sbc ; border = ?
int 16
;------------------------------
; border color OK ?
;------------------------------
call sacm
scp 12,0
call mcr3
lea ax,cokm
call lmts
mov rr,32
dci rr
cmp rr,'y'
je rsbbc
jmp rbc
;
;------------------------------------
; request screen border box color
;------------------------------------
rsbbc:
call sacm
call lsccm
scp 12,0
call mcr3
lea ax,rsbcm
call lmts
call vcp
cmp vcf,1
je rbbcrtd
cmp vcf,2
je rsbbc
mov sbbc,al
jmp rbblc
;
rbbcrtd: jmp rtd
;
;-----------------------------------
; request border box line color
;-----------------------------------
rbblc:
scp 12,0
call mcr3
lea ax,rsblcm
call lmts
call vcp
cmp vcf,1
je rbbcrtd
cmp vcf,2
je rbblc
mov srtc,al
jmp sbacc
;
;----------------------------------
; set box and crsr colors
;----------------------------------
sbacc:
mov al,sbbc
mov cl,4
shl al,cl
or al,srtc
mov cbbc,al
;
;------------------------------
; border box color OK ?
;------------------------------
call sacm
scp 12,0
call mcr3
lea ax,cokm
call lmts
;
mov rr,32
dci rr
cmp rr,'y'
je rsc
jmp rsbbc
;-----------------------------
; request screen color
;-----------------------------
rsc:
call sacm
call lsccm
scp 12,0
call mcr3
lea ax,rscm
call lmts
call vcp
cmp vcf,1
je rscrtd
cmp vcf,2
je rsc
mov ssc,al
jmp rcc
;
rscrtd: jmp rtd
;
;-----------------------------
; request cursor color
;-----------------------------
rcc:
scp 12,0
call mcr3
lea ax,rtcm
call lmts
call vcp
cmp vcf,1
je rtcrtd
cmp vcf,2
je rcc
mov srtc,al
jmp ssacc
;
rtcrtd: jmp rtd
;
;----------------------------------
; set screen and crsr colors
;----------------------------------
ssacc:
mov al,ssc
mov cl,4
shl al,cl
or al,srtc
mov cstc,al
;
;------------------------------
; set screen color OK
;------------------------------
sscok:
call sacm
scp 12,0
call mcr3
lea ax,cokm
call lmts
;
mov rr,32
dci rr
cmp rr,'y'
je rbgc
jmp rsc
;------------------------------------
; request back ground color
;------------------------------------
rbgc:
call lbfcm
scp 12,0
call mcr3
lea ax,rbgcm
call lmts
dci bcs
dci bcs+1
;----------------------------------
; request fore ground color
;----------------------------------
rfgc:
scp 12,0
call mcr3
lea ax,rfgcm
call lmts
dci fcs
dci fcs+1
;
dsts ess
;------------------------------
; set text color ok
;------------------------------
stcok:
call sacm
scp 12,0
call mcr3
lea ax,cokm
call lmts
;
mov rr,32
dci rr
cmp rr,'y'
je rtam
jmp rbgc
;
;-----------------------
; request try again msg
;-----------------------
rtam:
scp 12,0
call mcr3
lea ax,tam
call lmts
;
mov rr,32
dci rr
cmp rr,'y'
jne rtd
jmp ms
;*---------------------
;* return to dos
;*---------------------
rtd:
;
cmp vcf,1 ; esc ?
jne rtdn ; if not, carry on
mov rr,32 ; clear reply
jmp fex ; exit
rtdn:
scp 15,0
call mcr3
lea ax,satcm ; save all these colors msg
call lmts
;
mov rr,32 ; clear reply
dci rr ; get reply
;
cmp rr,'y' ; yes ?
je ltca
;
sebc ; set eight back colors
;
call rcaa ; reset char and attr
jmp fex ; exit
;
ltca:
;
call sacm
;
scp 12,0
call mcr3
lea ax,conm ; clone or not msg
call lmts
;
mov rr,32 ; clear reply
dci rr ; get reply
;
cmp rr,'y' ; yes ?
jne fex ; if not, exit
;
lea dx,ofn ; pass file name address
mov cx,0 ; set file attribute = normal
mov ah,60 ; pass code for creation open
dc ; DOS call
mov ofh,ax ; save output file handle
;
lea cx,eop ; point to end
lea ax,sop ; point to start
sub cx,ax ; end - start
mov bx,ofh ; point to output file handle
lea dx,sop ; set address
mov ah,64 ; pass DOS write a file code
dc ; DOS call
;
; exit
;
fex:
;
mov ef,1
;
call sacm
;
lea ax,cll
call lmts
call mcr3
;
exit
;
tssc endp
;
; set all color modes
;
sacm proc near
scp 0,0
; ssbc
scm sbc
wcaa cstc
mov al,cbbc
mov attr,al
call pab
dsts ess
cmp ef,1
je sacmx
;
;
; send starting message
;
scp 3,0
call mcr3
lea ax,sm1
call lmts
call mcr3
lea ax,sm2
call lmts
call mcr3
lea ax,sm3
call lmts
call mcr3
lea ax,sm4
call lmts
call mcr3
lea ax,sm5
call lmts
call mcr3
lea ax,sm6
call lmts
call mcr3
lea ax,sm7
call lmts
;
sacmx: ret
;
sacm endp
;
;--------------------------------
; list screen cursor color msg
;--------------------------------
lsccm proc near
scp 20,0
call mcr3
lea ax,acm1
call lmts
scp 21,0
call mcr3
lea ax,acm2
call lmts
ret
lsccm endp
;----------------------------------------
; list background foreground color msg
;----------------------------------------
lbfcm proc near
scp 20,0
call mcr3
lea ax,acm3
call lmts
scp 21,0
call mcr3
lea ax,acm4
call lmts
ret
lbfcm endp
;---------------------------------
; validate colors procedure
;---------------------------------
vcp proc near
mov vcf,0
;
mov rr,32
dci rr
cmp rr,ek ; reject ?
je vcpr
cmp rr,'0'
jb vcpe ; if LT, error
cmp rr,'f'
ja vcpe ; if GT, error
mov al,rr
call cath
cmp al,255
je vcpe
;
vcpx: ret
;
vcpe: mov vcf,2 ; error
ret
vcpr: mov vcf,1
ret
vcp endp
;
; included procedures
; from /masminc
;
.xlist
include cath.prc
include mcr3.prc
include lmts.prc
include pab.prc
include pac.prc
include par.prc
include rcaa.prc
include scaa.prc
.list
.xcref
;
db ' end of program'
;
eop: ; end of program
;
code ends
;
end sop